package uaiContacts.model;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.List;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToMany;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;

/**
 *
 * @author Droog
 */
@Entity
@Table(name = "tb_movimentacao_caixa_mes", catalog = "sistema_ipi", schema = "public")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "MovimentacaoCaixaMes.findAll", query = "SELECT m FROM MovimentacaoCaixaMes m"),
    @NamedQuery(name = "MovimentacaoCaixaMes.findByMesAno", query = "SELECT m FROM MovimentacaoCaixaMes m WHERE m.mesAno = :mesAno"),
    @NamedQuery(name = "MovimentacaoCaixaMes.findByTotalEntrada", query = "SELECT m FROM MovimentacaoCaixaMes m WHERE m.totalEntrada = :totalEntrada"),
    @NamedQuery(name = "MovimentacaoCaixaMes.findByTotalSaida", query = "SELECT m FROM MovimentacaoCaixaMes m WHERE m.totalSaida = :totalSaida"),
    @NamedQuery(name = "MovimentacaoCaixaMes.findByBalanco", query = "SELECT m FROM MovimentacaoCaixaMes m WHERE m.balanco = :balanco")})
public class MovimentacaoCaixaMes implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @NotNull
    @Column(name = "mes_ano", nullable = false)
    private Integer mesAno;
    // @Max(value=?)  @Min(value=?)//if you know range of your decimal fields consider using these annotations to enforce field validation
    @Column(name = "total_entrada", precision = 10, scale = 2)
    private BigDecimal totalEntrada;
    @Column(name = "total_saida", precision = 10, scale = 2)
    private BigDecimal totalSaida;
    @Column(precision = 10, scale = 2)
    private BigDecimal balanco;
    @ManyToMany(mappedBy = "movimentacaoCaixaMesList")
    private List<LancamentoFincanc> lancamentoFincancList;
    @JoinColumn(name = "id_igreja", referencedColumnName = "id_igreja", nullable = false)
    @ManyToOne(optional = false)
    private DadosIgreja idIgreja;

    public MovimentacaoCaixaMes() {
    }

    public MovimentacaoCaixaMes(Integer mesAno) {
        this.mesAno = mesAno;
    }

    public Integer getMesAno() {
        return mesAno;
    }

    public void setMesAno(Integer mesAno) {
        this.mesAno = mesAno;
    }

    public BigDecimal getTotalEntrada() {
        return totalEntrada;
    }

    public void setTotalEntrada(BigDecimal totalEntrada) {
        this.totalEntrada = totalEntrada;
    }

    public BigDecimal getTotalSaida() {
        return totalSaida;
    }

    public void setTotalSaida(BigDecimal totalSaida) {
        this.totalSaida = totalSaida;
    }

    public BigDecimal getBalanco() {
        return balanco;
    }

    public void setBalanco(BigDecimal balanco) {
        this.balanco = balanco;
    }

    @XmlTransient
    public List<LancamentoFincanc> getLancamentoFincancList() {
        return lancamentoFincancList;
    }

    public void setLancamentoFincancList(List<LancamentoFincanc> lancamentoFincancList) {
        this.lancamentoFincancList = lancamentoFincancList;
    }

    public DadosIgreja getIdIgreja() {
        return idIgreja;
    }

    public void setIdIgreja(DadosIgreja idIgreja) {
        this.idIgreja = idIgreja;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (mesAno != null ? mesAno.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof MovimentacaoCaixaMes)) {
            return false;
        }
        MovimentacaoCaixaMes other = (MovimentacaoCaixaMes) object;
        if ((this.mesAno == null && other.mesAno != null) || (this.mesAno != null && !this.mesAno.equals(other.mesAno))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "model.MovimentacaoCaixaMes[ mesAno=" + mesAno + " ]";
    }
    
}